home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / MOVMEM.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  415 b   |  13 lines

  1. /* movmem.c, from p.159 of Turbo C Bible  */
  2. /* Copies a block of bytes of a buffer to a another
  3.          (handles overlapping source and destination). */
  4. #include <stdio.h>
  5. #include <string.h>
  6. static char src[80]="FirstSecond";
  7. main()
  8. {
  9.     printf("Before movmem: Source = %s\n", src);
  10.     movmem(&src[5], src, sizeof(src));
  11.                     /* Copy from source to itself    */
  12.     printf("After  movmem: Source = %s\n", src);
  13. }